package cn.com.open.itembank.common.enums;

/**
 * 枚举：试卷导出
 * 0：仅试卷、  1：试卷和答案、  2：试卷含答案
 */
public enum PaperImportType {
    /**
     * 试卷
     */
    PAPER(0),
    /**
     * 试卷和答案
     */
    PAPER_AND_ANSWER(1),
    /**
     * 试卷含答案
     */
    PAPER_INCLUDE_ANSWER(2);

    private Integer index;

    PaperImportType(Integer idx) {
        this.index = idx;
    }

    /**
     * Gets index.
     *
     * @return the index
     */
    public Integer getIndex() {
        return index;
    }

    /**
     * From value check type.
     *
     * @param v the v
     * @return the check type
     */
    public static PaperImportType fromValue(Integer v) {
        for (PaperImportType c : PaperImportType.values()) {
            if (c.getIndex() == v) {
                return c;
            }
        }
        return null;
    }
}

